/*
 * 权限验证
 * Created by RisingSun. 
 * User: MarkSpace 
 * Date: 20220315
 * Time: 11:05 
*/
layui.extend({
  base: '/static/lay/' //静态资源所在路径
}).define(['jquery'],function(exports){ //提示：模块也可以依赖其它模块，

var $ = layui.jquery;
let langs={};
var lang={
	/*
     * 获取语言数据
     * 参数解释：
       url   
    */
    init:function(dataurl=null){
        dataurl=dataurl?dataurl:'/admin/common/lang';
    	  $.ajax({
            url: dataurl,
            async:false,
            type: 'post',
            dataType: "json",
            success:function(R){
                if (R.code == 200) {
                    langs=R.lang;
                } else {
                    console.log('data is null');
                }
            },
            error: function (R) {
              console.log('failure to send to database');
            }
        });
        return langs;
    }
}
exports('lang', lang);
});
